<?php include './functions.php';?>
<html>
    <head>
        <meta charset="UTF-8">
        <link href="style.css" rel="stylesheet" type="text/css"/>
        <title>Web</title>
    </head>
    <body>
        <div class="wrapper">
            <?php
            // put your code here
            $sqlstu='select * from students';
            $sqlsta='select * from staffs';
            $students=query($sqlstu);
            $staffs=  query($sqlsta)
            //var_dump($students);
            ?>
            <div class="title">LIST OF STUDENTS</div>
                <table>
                    <tr>
                        <th>ID</th>
                        <th>NAME</th>
                        <th>Xóa</th>
                        <th>Update Name</th>
                    </tr>
                    <?php foreach ($students as $student):?>
                    <tr>
                        <td><?php echo $student['id']?></td>
                        <td><?php echo $student['name']?></td>
                        <td>
                            <form action="delete.php?id=<?php echo $student['id']?>" method="post">
                                <input type="submit" value="Delete">
                            </form>
                        </td>
                        <td>
                            <form action="update.php?id=<?php echo $student['id']?>" method="post">
                                <input type="text" name="edit_1" id="editname"/>
                                <input type="submit" value="Edit">
                            </form>
                        </td>
                    </tr>
                    <?php endforeach;?>
                </table>
            <div>Insert database</div>
            <form id="form1" name="form1" method="post" action="insert.php">
                <label>ID</label>
                <input type="text" name="basic_name1" id="textfield" />
                <label>Name</label>
                <input type="text" name="basic_name2" id="textfield" />
                <input type="submit" name="button" id="button" value="Thêm" />
            </form>
             <div>
                <h2>Search for name</h2>
                <form name="timkiem" action="search.php" method="post">
                <input type="text" name="user" value="" size="25px" /><input type="submit" name="ok" value="Search" />
                </form>
            </div>
    </body>
</html>


